# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=droidcam
pkgver=2.1.2
pkgrel=0
pkgdesc="GNU/Linux client for DroidCam"
url="https://github.com/dev47apps/droidcam/"
arch="all"
license="GPL-2.0-only"
makedepends="
	alsa-lib-dev
	ffmpeg-dev
	glib-dev
	gtk+3.0-dev
	libayatana-appindicator-dev
	libjpeg-turbo-dev
	libusbmuxd-dev
	linux-headers
	speex-dev
	"
subpackages="$pkgname-gui"
install="$pkgname.post-install"
source="https://github.com/dev47apps/droidcam/archive/refs/tags/v$pkgver/droidcam-$pkgver.tar.gz
	makefile.patch
	release-paths.patch
	"
options="!check"

build() {
	make APPINDICATOR=ayatana-appindicator3-0.1
}

package() {
	install -Dm755 -t "$pkgdir"/usr/bin \
		droidcam \
		droidcam-cli

	install -Dm644 icon2.png "$pkgdir"/usr/share/droidcam/icon.png
	install -Dm644 droidcam.desktop -t "$pkgdir"/usr/share/applications
}

gui() {
	pkgdesc="$pkgdesc (GUI)"

	amove usr/bin/droidcam
	amove usr/share
}

sha512sums="
7879c5c8998618998856fe2a436f6ed5707b9d27609fbd32ac1282643721bf3d364658f5fe5030970946fea82faf9bf2e18add38a78e8a824647fea717c53cc4  droidcam-2.1.2.tar.gz
cb43712132eae371d2ed06462ba2e5ab69b50d1494ef1bf942d867302aaa4f169bfa0b02c930076c17bca44d7dfdb754aa38413a67b75fda10ff01ede8748e80  makefile.patch
33da7e155447a75cc0d88274c4b053c3cb6867aba411176b82b968bb690d60d429d3a39b1caf3bafe79c0958b24f7f6777e42e88de7c71b7eb271d196b7d50b9  release-paths.patch
"
